package com.experiment2;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class ApplicationReadyLis implements ApplicationListener<ApplicationReadyEvent> {
    private Logger logger = LoggerFactory.getLogger(ApplicationReadyLis.class);

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
       logger.info("成功监听事件");
    }
}